home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / emula / arosdv19.lha / AROS / exec / freevec.c < prev    next >
C/C++ Source or Header  |  1996-10-24  |  2KB  |  77 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: freevec.c,v 1.7 1996/10/24 15:50:50 aros Exp $
  4.     $Log: freevec.c,v $
  5.     Revision 1.7  1996/10/24 15:50:50  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.6  1996/10/23 14:13:44  aros
  9.     Use AROS_ALIGN() to align pointers
  10.  
  11.     Revision 1.5  1996/10/19 17:07:26  aros
  12.     Include <aros/machine.h> instead of machine.h
  13.  
  14.     Revision 1.4  1996/08/13 13:56:03  digulla
  15.     Replaced AROS_LA by AROS_LHA
  16.     Replaced some AROS_LH*I by AROS_LH*
  17.     Sorted and added includes
  18.  
  19.     Revision 1.3  1996/08/01 17:41:12  digulla
  20.     Added standard header for all files
  21.  
  22.     Desc:
  23.     Lang: english
  24. */
  25. #include "exec_intern.h"
  26. #include <aros/libcall.h>
  27. #include <aros/machine.h>
  28. #include "memory.h"
  29.  
  30. /*****************************************************************************
  31.  
  32.     NAME */
  33.     #include <clib/exec_protos.h>
  34.  
  35.     AROS_LH1(void, FreeVec,
  36.  
  37. /*  SYNOPSIS */
  38.     AROS_LHA(APTR, memoryBlock, A1),
  39.  
  40. /*  LOCATION */
  41.     struct ExecBase *, SysBase, 115, Exec)
  42.  
  43. /*  FUNCTION
  44.     Free some memory allocated with allocvec.
  45.  
  46.     INPUTS
  47.     memoryBlock - The memory to be freed. It is safe to free a NULL pointer.
  48.  
  49.     RESULT
  50.  
  51.     NOTES
  52.  
  53.     EXAMPLE
  54.  
  55.     BUGS
  56.  
  57.     SEE ALSO
  58.     AllocVec()
  59.  
  60.     INTERNALS
  61.  
  62.     HISTORY
  63.     15-10-95    created by m. fleischer
  64.  
  65. ******************************************************************************/
  66. {
  67.     AROS_LIBFUNC_INIT
  68.  
  69.     /* If there's nothing to free do nothing. */
  70.     if (memoryBlock != NULL)
  71.     {
  72.     *(UBYTE **)&memoryBlock -= AROS_ALIGN(sizeof(ULONG));
  73.     FreeMem (memoryBlock, *((ULONG *)memoryBlock));
  74.     }
  75.     AROS_LIBFUNC_EXIT
  76. } /* FreeVec */
  77.